home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / cshx86.zip / SAMPLES / README < prev    next >
Text File  |  1993-04-14  |  5KB  |  128 lines

  1. Hamilton C shell(tm) Samples Directory, Release 2.1
  2. Copyright (c) 1989-1993 by Hamilton Laboratories.  All rights reserved.
  3.  
  4. The sample C programs and C shell scripts in this directory are meant
  5. to help you install or experiment with Hamilton C shell.  Deliberately,
  6. they're relatively trivial.
  7.  
  8. (All these files should be viewed with TABS=3)
  9.         
  10.  
  11. args.c         A simple C program that prints out the *argv[] (argument)
  12.                     and *envp[] (environmental variable) arrays.  Notice that
  13.                     wildcarding, variable substitutions, quoting and command
  14.                     substitutions are done before the C program is started.  If
  15.                     you do a lot of wildcarding, you can create and pass VERY
  16.                     long parameter lists (up 64K characters).  Try some of these
  17.                     commands:
  18.  
  19.                         % args "ho"w 'no'w
  20.                         % args "$cwd" '$cwd'
  21.                         % args * "*" '*'
  22.                         % args `whereis more`
  23.                         % args '`whereis more`'
  24.                         % args * *\* *\*\* | more
  25.  
  26. bits.csh            A simple self-loading procedure that calculates the minimum
  27.                     bits required to represent the argument it's passed as a
  28.                     binary integer.
  29.  
  30. bumpdate.csh    Print the date n number of days forward or backward from a
  31.                     given date.  If only the bump value is given, today's date
  32.                     is bumped.
  33.  
  34. caldate.csh        Print the date corresponding to a given Julian day.
  35.  
  36. calendar.csh    A C shell script for printing out the calendar for any
  37.                     given month, highlighting the current date.  If no date
  38.                     is given, this month's calendar is printed.
  39.  
  40. cl.csh            Run the C compiler and linker for an NT program.  Avoids
  41.                     having to fool with a make file just to compile hello, world.
  42.                     Works pretty much just like the cl command on DOS would.
  43.  
  44. colors.csh        Instructions and examples on customizing the screen colors.
  45.  
  46. deltaday.csh    Print the number of days separating two dates.  If only
  47.                     one date is given, the difference between it and today's date
  48.                     is returned.
  49.  
  50. dumpenv.c        This C program writes out the environment it's passed in
  51.                     the form of setenv commands.
  52.  
  53. duplicat.csh    Look for duplicate files anywhere in a directory tree.
  54.  
  55. easter.csh        A C shell script that calculates when Easter will occur in
  56.                     any given year.  If no year is given, the current year is
  57.                     assumed.
  58.  
  59. factor.csh        The simple factor C shell script shown in the User Guide.
  60.                     Intended to show examples of recursion, expressions, and
  61.                     a self-loading procedure.
  62.  
  63. finance.csh        Another C shell script showing expression evalution.  This
  64.                     defines a number of routines for calculating financial
  65.                     conversion factors, e.g., from present to future value.
  66.  
  67. julian.csh        Calculate the Julian day number (number of days since January 1,
  68.                     4713 BC) for any given date.  If you don't give a date, it
  69.                     uses today's date.
  70.  
  71. makecpgm.csh    A simple C shell script showing how a "make" function might
  72.                     be written in the C shell language.  This one rebuilds any
  73.                     .exe files in the current directory that are older than the
  74.                     corresponding .c file or any of the .h files.
  75.  
  76. mcvisa.csh        A simple C shell script that constructs a special checksum
  77.                     of a credit card number to tell if the card number is
  78.                     plausible or not.  The checksum used is designed to catch
  79.                     transposed or incorrect digits.  Try it on the cards in
  80.                     your wallet.
  81.  
  82. myecho.c            A variation on the builtin echo command that prints its
  83.                     *argv[] (argument) list with quotes around each word it's
  84.                     passed and tells the total character count.  Try these
  85.                     examples:
  86.  
  87.                         % myecho now     is the
  88.                         % myecho "now     is" the
  89.                         % myecho `ls`
  90.                         % myecho `echo`
  91.                         % myecho `echo hello`
  92.                         % myecho * *\* *\*\* | more
  93.  
  94. newfiles.csh    List all the files or directories in the current directory
  95.                     that do not occur in the specified directory.
  96.  
  97. postage.csh        Calculate the U.S. first class postage required for a
  98.                     given weight in ounces.
  99.  
  100. rcode.c            A trivial C program that just prints, then exits with the
  101.                     return code value you pass it.  You can use this routine to
  102.                     see how the status variable is set and also, how the ";",
  103.                     "||" and "&&" statement connectors work.  Try these examples:
  104.  
  105.                         % rcode
  106.                         % calc status
  107.                         % rcode 1
  108.                         % calc status
  109.                         % echo $status
  110.                         % echo status
  111.                         % rcode 2
  112.                         % calc status
  113.                         % rcode 0 || rcode 1
  114.                         % rcode 1 || rcode 2
  115.                         % rcode 0 && rcode 1
  116.                         % rcode 1 && rcode 2
  117.                         % rcode 0 ;  rcode 1
  118.                         % rcode 1 ;  rcode 2
  119.  
  120. sizeof.csh        A C shell script that calculates the total disk space used
  121.                     by whatever files or directories are given as arguments.
  122.                     
  123. ts.csh            A C shell script that searches for occurrences of a simple
  124.                     string in all the files with a given extension anywhere in
  125.                     a directory tree.
  126.  
  127. weekday.csh        Print the day of the week corresponding to any given date.
  128.